#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 20;
int n, a[N], ans;

void dfs(int x, int pos) {
    if (pos >= 7 || pos <= -7) pos %= 7;
    if (x == n) {
        if (pos == 0) ans++;
        return;
    }
    dfs(x + 1, pos - a[x + 1]);
    dfs(x + 1, pos + a[x + 1]);
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    dfs(0, 0);
    double total = pow(2, n);
    cout << fixed << setprecision(4) << round(ans / total * pow(10, 4)) / pow(10, 4) << endl;
    return 0;
}




